const express = require('express')
const StudentRouter = express.Router()
const StudentController = require('../controllers/StudentController.js')

const multer = require('multer')
const upload = multer({ dest: 'public/avataruploads/' })

StudentRouter.post('/api/student/add', upload.single('file'), StudentController.add)
StudentRouter.get('/api/student/list', StudentController.getList)
StudentRouter.delete('/api/student/list/:username', StudentController.delList)
StudentRouter.get('/api/student/list/:username', StudentController.getList)
StudentRouter.put('/api/student/list/:username', StudentController.putList)
StudentRouter.get('/api/student/scorelist/:major', StudentController.getScoreList)

module.exports = StudentRouter
